package com.wumeng.dynamicmultidatabase01.modules.user.service.impl;

import com.wumeng.dynamicmultidatabase01.modules.user.dao.User;
import com.wumeng.dynamicmultidatabase01.modules.user.mapper.UserMapper;
import com.wumeng.dynamicmultidatabase01.modules.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wumeng 2022/6/8 5:28 下午
 *  * 多条件查询
 *  * name=1907班 and age < 20
 *  * = (等于用“eq”)
 *  * > (大于用“gt”)
 *  * <(小于用" lt")
 *  * >=(大于等于用"ge")
 *  * <=(小于等于用"le")
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public int add(User user) {
        return userMapper.add(user);
    }

    @Override
    public int update(User user) {
        return userMapper.update(user);
    }

    @Override
    public void deleteById(int id) {
        userMapper.deleteById(id);
    }

    @Override
    public User queryUserById(int id) {
        return userMapper.queryUserById(id);
    }
}